﻿/*
 Author:du
 Time:2017.11.8
*/

using FutureCoreEditor;
using System;
using UnityEditor;
using UnityEngine;

public class GEditorTool
{
    #region Project
    public static string ProjectPath = Application.dataPath.Split(new string[] { "Assets" }, StringSplitOptions.None)[0];
    public static string GameResourcesPath = Application.dataPath + "/_Game/Resources/";
    public static string GameResourcesArtPath = Application.dataPath + "/_Game/ResourcesArt/";
    public static string PluginsPath = Application.dataPath + "/Plugins/";

    public static string ABOutputPath = Application.streamingAssetsPath + "/www";
    public static string ABZipOutputFilePath = Application.streamingAssetsPath + "/www.zip";
    public static string ABVersionFilePath = Application.streamingAssetsPath + "/version.txt";

    public const string ABExtension = EPAppConst.ABExtName;
    public const string ABManifestExtension = ".manifest";

    public const string AtlasTP_RECT = "[RECT]";
    public const string AtlasTP_TIGHT = "[TIGHT]";
    #endregion

    #region AssetPath
    /// 目录
    // 加载资源
    public static string AnimPath = GameResourcesPath + EPAssetPakConst.Anim;
    public static string AtlasPath = GameResourcesArtPath + EPAssetPakConst.Atlas;
    public static string AudioPath = GameResourcesPath + EPAssetPakConst.Audio;
    public static string DataPath = GameResourcesPath + EPAssetPakConst.Data;
    public static string DynamicFontPath = GameResourcesPath + EPAssetPakConst.DynamicFont;
    public static string EffectPath = GameResourcesArtPath + EPAssetPakConst.Effect;
    public static string FramesPath = GameResourcesArtPath + EPAssetPakConst.Frames;
    public static string ModulePath = GameResourcesPath + EPAssetPakConst.Module;
    public static string ScenePath = GameResourcesPath + EPAssetPakConst.Prefab;
    public static string SkeletonPath = GameResourcesArtPath + EPAssetPakConst.Skeleton;
    public static string SpritePath = GameResourcesArtPath + EPAssetPakConst.Sprite;
    public static string TexturePath = GameResourcesPath + EPAssetPakConst.Texture;
    public static string VideoPath = GameResourcesPath + EPAssetPakConst.Video;
    // 公共加载资源
    public static string ShaderPath = GameResourcesArtPath + EPAssetPakConst.Shader;
    public static string MaterialPath = GameResourcesPath + EPAssetPakConst.Material;
    public static string StaticFontPath = GameResourcesPath + EPAssetPakConst.StaticFont;
    public static string EffectLibPath = GameResourcesArtPath + EPAssetPakConst.EffectLib;
    // 公共基础资源
    public static string SpineShadersPath = PluginsPath + EPAssetPakConst.SpineShaders;
    public static string SpineGraphicShadersPath = PluginsPath + EPAssetPakConst.SpineGraphicShaders;

    /// 指定
    // 公共基础资源文件: SpineShader-Fill
    public static string SpineSkeletonShaderFillFile = PluginsPath + EPAssetPakConst.SpineSkeletonShaderFillFile;
    // 公共基础资源文件: SpineEditorIcon
    public static string SpineEditorGUIAtlasAssetIconFile = PluginsPath + EPAssetPakConst.SpineEditorGUIAtlasAssetIconFile;
    public static string SpineEditorGUISkeletonDataAssetIconFile = PluginsPath + EPAssetPakConst.SpineEditorGUISkeletonDataAssetIconFile;
    #endregion

    #region Func
    public static string GetPlatformName(BuildTarget target)
    {
        string s = null;
        switch (target)
        {
            case BuildTarget.StandaloneWindows:
            case BuildTarget.StandaloneWindows64:
                s = "windows";
                break;
            case BuildTarget.Android:
                s = "android";
                break;
            case BuildTarget.iOS:
                s = "ios";
                break;
            case BuildTarget.StandaloneOSXIntel:
            case BuildTarget.StandaloneOSXIntel64:
            case BuildTarget.StandaloneOSXUniversal:
                s = "osx";
                break;
            case BuildTarget.WebGL:
                s = "webgl";
                break;
        }
        return s;
    }
    #endregion
}